/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package modelo;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Fabian
 */
@Entity
@Table(name = "jefe_de_investigacion")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "JefeDeInvestigacion.findAll", query = "SELECT j FROM JefeDeInvestigacion j"),
    @NamedQuery(name = "JefeDeInvestigacion.findByNombre", query = "SELECT j FROM JefeDeInvestigacion j WHERE j.nombre = :nombre"),
    @NamedQuery(name = "JefeDeInvestigacion.findByCedula", query = "SELECT j FROM JefeDeInvestigacion j WHERE j.cedula = :cedula"),
    @NamedQuery(name = "JefeDeInvestigacion.findByTelefono", query = "SELECT j FROM JefeDeInvestigacion j WHERE j.telefono = :telefono"),
    @NamedQuery(name = "JefeDeInvestigacion.findByCelular", query = "SELECT j FROM JefeDeInvestigacion j WHERE j.celular = :celular"),
    @NamedQuery(name = "JefeDeInvestigacion.findByDireccion", query = "SELECT j FROM JefeDeInvestigacion j WHERE j.direccion = :direccion"),
    @NamedQuery(name = "JefeDeInvestigacion.findByEMail", query = "SELECT j FROM JefeDeInvestigacion j WHERE j.eMail = :eMail"),
    @NamedQuery(name = "JefeDeInvestigacion.findByCargo", query = "SELECT j FROM JefeDeInvestigacion j WHERE j.cargo = :cargo")})
public class JefeDeInvestigacion implements Serializable {
    private static final long serialVersionUID = 1L;
    @Basic(optional = false)
    @Column(name = "nombre")
    private String nombre;
    @Id
    @Basic(optional = false)
    @Column(name = "cedula")
    private String cedula;
    @Column(name = "telefono")
    private String telefono;
    @Column(name = "celular")
    private String celular;
    @Column(name = "direccion")
    private String direccion;
    @Basic(optional = false)
    @Column(name = "e_mail")
    private String eMail;
    @Basic(optional = false)
    @Column(name = "cargo")
    private String cargo;
    @JoinColumn(name = "cedula", referencedColumnName = "login", insertable = false, updatable = false)
    @OneToOne(optional = false)
    private Usuario usuario;

    public JefeDeInvestigacion() {
    }

    public JefeDeInvestigacion(String cedula) {
        this.cedula = cedula;
    }

    public JefeDeInvestigacion(String cedula, String nombre, String eMail, String cargo) {
        this.cedula = cedula;
        this.nombre = nombre;
        this.eMail = eMail;
        this.cargo = cargo;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getCedula() {
        return cedula;
    }

    public void setCedula(String cedula) {
        this.cedula = cedula;
    }

    public String getTelefono() {
        return telefono;
    }

    public void setTelefono(String telefono) {
        this.telefono = telefono;
    }

    public String getCelular() {
        return celular;
    }

    public void setCelular(String celular) {
        this.celular = celular;
    }

    public String getDireccion() {
        return direccion;
    }

    public void setDireccion(String direccion) {
        this.direccion = direccion;
    }

    public String getEMail() {
        return eMail;
    }

    public void setEMail(String eMail) {
        this.eMail = eMail;
    }

    public String getCargo() {
        return cargo;
    }

    public void setCargo(String cargo) {
        this.cargo = cargo;
    }

    public Usuario getUsuario() {
        return usuario;
    }

    public void setUsuario(Usuario usuario) {
        this.usuario = usuario;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cedula != null ? cedula.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof JefeDeInvestigacion)) {
            return false;
        }
        JefeDeInvestigacion other = (JefeDeInvestigacion) object;
        if ((this.cedula == null && other.cedula != null) || (this.cedula != null && !this.cedula.equals(other.cedula))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "modelo.JefeDeInvestigacion[ cedula=" + cedula + " ]";
    }
    
}
